<template>
  <div class="detailbar"
       v-if="list.length!=0">
    <div class="item"
         v-for="(item,index) in list"
         :key="index"
         @click="currentClick(index)"
         :class="{action:currentIndex==index}">{{item}}</div>
  </div>
</template>

<script>
export default {
  name: 'ArtistBar',
  props: {
    list: {
      type: Array,
      default () {
        return [];
      }
    },
    aid: {
      type: String,
      default () {
        return '';
      }
    }
  },
  data () {
    return {
      currentIndex: 0
    };
  },
  methods: {
    currentClick (index) {
      this.currentIndex = index;
      switch (index) {
        case 0: this.$router.push('/artist/album/' + this.aid); break;
        case 1: this.$router.push('/artist/mv/' + this.aid); break;
        case 2: this.$router.push('/artist/desc/' + this.aid); break;
        case 3: this.$router.push('/artist/simi/' + this.aid); break;
      }
    }
  }
}
</script>

<style scoped>
.detailbar {
  padding: 10p 0;
  height: 59px;
  display: flex;
  align-items: center;
  color: #000 !important;
}
.detailbar .item {
  padding: 5px 20px;
}
.action {
  border-bottom: 3px solid #00aa85;
}
</style>
